function Deferred() {
  var self = this;
  var p = this.promise = new Promise(function (resolve, reject) {
    self.resolve = resolve;
    self.reject = reject;
  });
  this.then = this.promise.then.bind(p);
  this.catch = this.promise.catch.bind(p);
}

var Util = {
  Deferred
};

module.exports = Util;